home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol C-14
/
Vol C-14.iso
/
games
/
keepy_up.swf
/
scripts
/
DefineSprite_49
/
frame_8
/
DoAction.as
Wrap
Text File
|
2012-04-23
|
1KB
|
53 lines
kicked = 1;
t = Number(t) + 0.1;
oldx = x;
oldy = y;
x = getProperty("Ball", _X);
y = getProperty("Ball", _Y);
vx = Number((getProperty("Ball", _X) - getProperty("mouse", _X)) * 10) + Number(random(3) / 10 - 0.15);
vy = Number(-125) + Number(y - getProperty("mouse", _Y));
dx = getProperty("Ball", _X) - getProperty("mouse", _X);
if(0 < Number(dx))
{
vy = Number(vy) + Number(dx);
}
else if(Number(dx) < 0)
{
vy -= dx;
}
if(Number(y) < Number(BallRadius))
{
y = BallRadius;
vx *= elastic;
vy = - vy * elastic;
}
if(Number(300 - BallRadius) < Number(y))
{
if(Number(bestscore) < Number(score))
{
bestscore = score;
}
score = 0;
y = 300 - BallRadius;
vx *= elastic;
vy = - vy * elastic;
}
if(Number(x) < Number(BallRadius))
{
x = BallRadius;
vx = - vx * elastic;
vy *= elastic;
}
if(Number(400 - BallRadius) < Number(x))
{
x = 400 - BallRadius;
vx = - vx * elastic;
vy *= elastic;
}
setProperty("Ball", _X, x);
setProperty("Ball", _Y, y);
setProperty("Ball", _rotation, x);
setProperty("Ball", _xscale, 100);
setProperty("Ball", _yscale, 100);
gotoAndPlay(6);